<template>
  <el-table
    :data="list"
    v-loading="loading"
    lazy
    table-layout="auto"
  >
    <el-table-column prop="doctorId" label="医生ID" width="120" />
    <el-table-column prop="realName" label="医生姓名" />
    <el-table-column prop="name" label="服务类型" />
    <el-table-column prop="fee" label="服务费用" width="120">
      <template #default="{ row }">￥{{ row.fee }}</template>
    </el-table-column>
    <el-table-column label="操作" width="150" align="center">
      <template #default="{ row }">
        <el-button type="primary" link @click="emit('edit', row)">编辑</el-button>
        <el-button type="danger" link @click="emit('delete', row.serviceFeeId)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
defineProps({
  list: {
    type: Array,
    required: true,
    default: () => []
  },
  loading: {
    type: Boolean,
    default: false
  }
});

const emit = defineEmits(['edit', 'delete']);
</script>